# Generated by Django 4.2.6 on 2023-10-24 17:26

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):
    dependencies = [
        ("catalog", "0002_alter_item_tags"),
    ]

    operations = [
        migrations.CreateModel(
            name="Image",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "image",
                    models.ImageField(
                        upload_to="media/% Y/% m/% d/",
                        verbose_name="изображение",
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name="item",
            name="images",
            field=models.ManyToManyField(
                help_text="Неограниченное количество изображений",
                related_name="items",
                to="catalog.image",
                verbose_name="фотогалерея",
            ),
        ),
        migrations.AddField(
            model_name="item",
            name="main_image",
            field=models.OneToOneField(
                help_text="Крупная картинка товара",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="catalog.image",
                verbose_name="главное изображение",
            ),
        ),
    ]
